<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<center>
<table>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">이름 </font></td>
	<td ><input type="text" value="${requestScope.lbvo.name }" id="name"  name="name" readonly="readonly"> </td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">학년</font> </td>
	<td><input type="text" value="${requestScope.lbvo.grade }" id="grade"  name="grade" readonly="readonly"> </td>
</tr>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">성별</font></td>
	<td><input type="text" value="${requestScope.lbvo.gender }" id="gender"  name="gender" readonly="readonly"></td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">전화번호</font></td>
	<td><input type="text" value="${requestScope.lbvo.tel }" id="tel"  name="tel" readonly="readonly"></td>
</tr>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">원하는 수업</font></td>
	<td><input type="text" value="${requestScope.lbvo.hopesubject }" id="hopesubject"  name="hopesubject" readonly="readonly"></td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">연결여부</font></td>
	<td><input type="text" value="${requestScope.lbvo.connectstate }" readonly="readonly"></td>
</tr>
<tr>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">원하는 요일</font></td>
	<td><input type="text" value="${requestScope.lbvo.hopeday }" name="hopeday" ></td>
	<td bgcolor="#E6E6E6" width="100" align="center"><font size="2">원하는 시간</font></td>
	<td><input type="text" value="${requestScope.lbvo.hopetime }" name="hopetime" ></td>
</tr>
<tr>
	<td></td>
	<td></td>
	<td></td>
	<td>
	<input type="hidden" name="lessonno" value="${requestScope.lbvo.lessonno }">
	<input type="hidden" name="teacherid" value="${sessionScope.mvo.id }">
	<input type="hidden" name="membertype" value="${sessionScope.mvo.membertype }">
	<input type="hidden" name="listtype" value="t">
	<c:choose> 
	
	<%-- session 에 로그인한 사람의 찜 정보를 확인하여 해당 수업을 찜했었는지 체크한다. --%>
	
	<c:when test="${sessionScope.mvo.membertype=='t'&& sessionScope.selectedList=='[]' }">
		<div id="btnSpace">
			<input type="button" id="selectedBtn" value="찜하기">
		</div>
	 </c:when>
	<c:otherwise>
		<c:if test="${sessionScope.mvo!=null&&sessionScope.mvo.membertype=='t'}">
			<c:set value="${requestScope.lbvo.lessonno }" var="lessonno"></c:set>
			<c:set var="flag" value="false"></c:set>
			<c:forEach items="${sessionScope.selectedList}" var="list">
				<c:if test="${list==lessonno}">
					<c:set var="flag" value="true"></c:set>
				</c:if>
			</c:forEach>
			<c:choose>
				<c:when test="${flag=='false' && sessionScope.mvo.membertype=='t'}">
					<div id="btnSpace">
						<input type="button" id="selectedBtn" value="찜하기">
					</div>
				</c:when>
				<c:otherwise>
					<div id="btnSpace">
						<input type="button" name="moveSelectedList" value="찜리스트 보기">
					</div>
				</c:otherwise>
			</c:choose>
		</c:if>
	</c:otherwise>
	</c:choose> 
	</td>
</tr>
</table>
<hr>
<table>
<tr>
	<td>번호:${requestScope.lbvo.lessonno }</td><td>제목:${requestScope.lbvo.title }</td>
</tr>
<tr>
	<td>작성일시:${requestScope.lbvo.datePosted }</td><td>조회수:${requestScope.lbvo.hits }</td>
</tr>
<tr>
	<td>작성자 : ${requestScope.lbvo.studentid }</td>
</tr>
<tr>
	<td colspan="2"><textarea rows="20" cols="50">${requestScope.lbvo.content }</textarea></td>
</tr>
<tr>

	<td colspan="2" align="center">
	<a href="lessonBoardSerch.do"><input type="button" value="목록"></a>
<c:choose>
<c:when test="${sessionScope.mvo.id==requestScope.lbvo.studentid }">
	<a href="updateLessonPage.do?lessonno=${requestScope.lbvo.lessonno }&studentid=${requestScope.lbvo.studentid}"><input type="button" value="수정하기"></a>
	<%-- <a href="deleteLessonContent.do?lessonno=${requestScope.lbvo.lessonno }"><input type="button" value="삭제" id="deleteNoticeBtn"></a> --%>
</c:when>
</c:choose>
	
	
	</td>
</tr>
</table>
</center>
